package com.api.shopapi.service.impl;

import com.api.shopapi.entity.DisableLevel;
import com.api.shopapi.entity.DiseaseType;
import com.api.shopapi.mapper.DisableLevelMapper;
import com.api.shopapi.mapper.DiseaseTypeMapper;
import com.api.shopapi.service.DisableLevelService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service("DisableLevelServiceImplOne")
public class DisableLevelServiceImplOne implements DisableLevelService {


    @Autowired
    private DisableLevelMapper disableLevelMapper;

    @Override
    public
    int insert(DisableLevel disableLevel){
        return disableLevelMapper.insert(disableLevel);
    }

    @Override
    public
    int update(DisableLevel disableLevel){
        return disableLevelMapper.update(disableLevel);
    }

    @Override
    public
    DisableLevel getByDisableLevelCode(String disableLevelCode){
        return disableLevelMapper.getByDisableLevelCode(disableLevelCode);
    }

    @Override
    public
    DisableLevel getByDisableLevelName(String disableLevelName){
        return disableLevelMapper.getByDisableLevelName(disableLevelName);
    }

    @Override
    public List<DisableLevel> listByInsCode(String institutionCode){
        return disableLevelMapper.listByInsCode(institutionCode);
    }

    @Override
    public PageInfo<DisableLevel> pageByInsCode(int pageIndex, int pageSize, String institutionCode){
        PageHelper.startPage(pageIndex,pageSize);
        List<DisableLevel> deviceTogWatchDTOList = disableLevelMapper.listByInsCode(institutionCode);
        return new PageInfo<>(deviceTogWatchDTOList);
    }

    @Override
    public
    PageInfo<DisableLevel> pageByGovCode(int pageIndex, int pageSize, String govCode){
        PageHelper.startPage(pageIndex,pageSize);
        List<DisableLevel> deviceTogWatchDTOList = disableLevelMapper.listByGovCode(govCode);
        return new PageInfo<>(deviceTogWatchDTOList);
    }

}
